package yingyong;

import java.lang.module.FindException;
import java.util.Scanner;

public class demo5 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Student stu = new Student();

        while (true) {
            try {
                String name = sc.nextLine();
                String age = sc.nextLine();
                int x = Integer.parseInt(age);
                stu.setAge(x);
                stu.setName(name);
                break;
            } catch (NumberFormatException e) {
                System.out.println("age is mistake");
            } catch (RuntimeException e) {
                System.out.println("name or age lie in error");
            }
        }

    }
}